package com.molin.innerClass.test2;

public class test2 {
    public static void main(String[] args) {
        new Inter(){  //Inter接口的实现,对象
            public void show(){ //方法的重写
                System.out.println("匿名方法");
            }
        }.show();

        //使用父接口接
        Inter2 inter2=new Inter2(){
            @Override
            public void show1() {
                System.out.println("show 1");
            }

            @Override
            public void show2() {
                System.out.println("show 2");
            }
        };
        inter2.show1();
        inter2.show2();
    }
}

interface Inter{
    void show();
}
interface Inter2{
    void show1();
    void show2();
}

class InterImpl implements Inter{
    public void show(){
        System.out.println("重写show方法");

    }}